<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                             "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:rich="http://richfaces.org/rich"
                template="../layout/admin_template.xhtml">
                       
<ui:define name="body">
    
    <h:messages globalOnly="true" styleClass="message"/>
    
    <h:form id="registerForm">

        <rich:panel>
            <f:facet name="header">登记新的快餐店</f:facet>
    
            <s:decorate id="nameDecoration" template="../layout/edit.xhtml">
                <ui:define name="label">店名</ui:define>
                <h:inputText id="name" required="true"
                             value="#{newSnackShop.name}"/>
            </s:decorate>
            <s:decorate id="telNoDecoration" template="../layout/edit.xhtml">
                <ui:define name="label">电话号码</ui:define>
				<h:inputText id="telNo" required="true" value="#{newSnackShop.telNo}"/>
            </s:decorate> 
          	<s:decorate id="addressDecoration" template="../layout/edit.xhtml">
                <ui:define name="label">地址</ui:define>
				<h:inputText id="address" value="#{newSnackShop.address}" size="50"/>
            </s:decorate> 
            <s:decorate id="memoDecoration" template="../layout/edit.xhtml">
                <ui:define name="label">备注</ui:define>
				<h:inputTextarea value="#{newSnackShop.memo}" rows="5" cols="50">
					
				</h:inputTextarea>
            </s:decorate>
        
            
            <div style="clear:both"/>
      </rich:panel>  


        <!-- actions -->
        <div class="actionButtons">
        
          <h:commandButton action="#{snackShopAction.update}" value="更新" rendered="#{snackShopAction.managed}" styleClass="inputButton"/>
          <s:button action="#{snackShopAction.remove}" value="删除" rendered="#{snackShopAction.managed}" styleClass="inputButton"/>
          <s:button view="/admin/viewSnackShop.xhtml" value="返回" rendered="#{snackShopAction.managed}" styleClass="inputButton"/>

          <h:commandButton action="#{snackShopAction.persist}" value="保存" rendered="#{!snackShopAction.managed}" styleClass="inputButton"/>
          <s:button view="/admin/snackShopList.xhtml" value="返回" rendered="#{!snackShopAction.managed}" styleClass="inputButton"/>

        </div>     
 
    </h:form>
    
</ui:define>

</ui:composition>

